package interfaces.menu.options;

import java.awt.DisplayMode;
import java.util.Comparator;

public class DisplayModeComparer implements Comparator<DisplayMode> {
	
	@Override
	public int compare(DisplayMode modeA, DisplayMode modeB) {
		if(modeA.getWidth() != modeB.getWidth()) 
			return (modeA.getWidth() > modeB.getWidth()) ?  1 : -1;
		if(modeA.getHeight() != modeB.getHeight()) 
			return (modeA.getHeight() > modeB.getHeight()) ?  1 : -1;
        return 0;
	}
}